﻿<div class="row">
    <div class="col-12 col-sm-6 overflow-hidden">
        <MultiSelect TValue="string" Items="@Items" IsPopover="true" ShowSearch="true" ShowToolbar />
    </div>
</div>

@code {
    [NotNull]
    private List<SelectedItem>? Items { get; set; }

    protected override void OnInitialized()
    {
        base.OnInitialized();
        Items = GenerateItems();
    }

    private static List<SelectedItem> GenerateItems() => new()
    {
        new ("Beijing", "北京"),
        new ("Shanghai", "上海"),
        new ("Guangzhou", "广州"),
        new ("Shenzhen", "深圳"),
        new ("Chengdu", "成都"),
        new ("Wuhan", "武汉"),
        new ("Dalian", "大连"),
        new ("Hangzhou", "杭州"),
        new ("Lianyungang", "连云港")
    };
}
